/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ghanaroutes.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "popularplacesloc")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Popularplacesloc.findAll", query = "SELECT p FROM Popularplacesloc p"),
    @NamedQuery(name = "Popularplacesloc.findByLocationId", query = "SELECT p FROM Popularplacesloc p WHERE p.locationId = :locationId"),
    @NamedQuery(name = "Popularplacesloc.findByPlaceId", query = "SELECT p FROM Popularplacesloc p WHERE p.placeId = :placeId"),
    @NamedQuery(name = "Popularplacesloc.findByLocationName", query = "SELECT p FROM Popularplacesloc p WHERE p.locationName = :locationName"),
    @NamedQuery(name = "Popularplacesloc.findByDescription", query = "SELECT p FROM Popularplacesloc p WHERE p.description = :description"),
    @NamedQuery(name = "Popularplacesloc.findByAddress", query = "SELECT p FROM Popularplacesloc p WHERE p.address = :address"),
    @NamedQuery(name = "Popularplacesloc.findByUserId", query = "SELECT p FROM Popularplacesloc p WHERE p.userId = :userId"),
    @NamedQuery(name = "Popularplacesloc.findByDateAdded", query = "SELECT p FROM Popularplacesloc p WHERE p.dateAdded = :dateAdded")})
public class Popularplacesloc implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "locationId")
    private Integer locationId;
    @Column(name = "placeId")
    private Integer placeId;
    @Size(max = 50)
    @Column(name = "locationName")
    private String locationName;
    @Size(max = 200)
    @Column(name = "description")
    private String description;
    @Size(max = 200)
    @Column(name = "address")
    private String address;
    @Column(name = "userId")
    private Integer userId;
    @Column(name = "dateAdded")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateAdded;

    public Popularplacesloc() {
    }

    public Popularplacesloc(Integer locationId) {
        this.locationId = locationId;
    }

    public Popularplacesloc(Integer locationId, Date dateAdded) {
        this.locationId = locationId;
        this.dateAdded = dateAdded;
    }

    public Integer getLocationId() {
        return locationId;
    }

    public void setLocationId(Integer locationId) {
        this.locationId = locationId;
    }

    public Integer getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Integer placeId) {
        this.placeId = placeId;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Date getDateAdded() {
        return dateAdded;
    }

    public void setDateAdded(Date dateAdded) {
        this.dateAdded = dateAdded;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (locationId != null ? locationId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Popularplacesloc)) {
            return false;
        }
        Popularplacesloc other = (Popularplacesloc) object;
        if ((this.locationId == null && other.locationId != null) || (this.locationId != null && !this.locationId.equals(other.locationId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ghanaroutes.entities.Popularplacesloc[ locationId=" + locationId + " ]";
    }
    
}
